package com.gdut.huayan.dao;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gdut.huayan.entity.po.Role;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;


@Mapper
public interface RoleMapper extends BaseMapper<Role> {

    //将 id 改成roleId
    @Select("SELECT * FROM `t_role` WHERE `id` = (SELECT `role_id` FROM `t_user_role` WHERE `user_id` = #{userId})")
    List<Role> getUserRole(Long userId);

}

